﻿<!DOCTYPE html>
<html lang="en">
<#include "../include/resource-head.ftl"/>
<body>
<#include "../include/common-top.ftl"/>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
    <#include "../include/common-menu.ftl"/>
        <div class="main-content">
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="form-search">
                            <form role="form" class="form-inline clearfix" id="form" action="">
                                <div class="input-group col-xs-3">
                                    <span class="input-group-addon">套餐名</span>
                                    <input type="text" class="form-control" name="name" value="${name!}">
                                </div>
                            </form>
                            <div class="form-tool btn-group">
                                <button class="btn btn-sm btn-success" form="form">
                                    <i class="icon-search"></i>搜索
                                </button>
                                <a class="btn btn-sm btn-primary" href="/tc/add">
                                    <i class="icon-plus"></i>添加
                                </a>
                            </div>
                        </div>
                        <div class="table-responsive">
                            <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>套餐名</th>
                                    <th>月租</th>
                                    <th>分钟数</th>
                                    <th>流量</th>
                                    <th>短信</th>
                                    <th>套餐外语音</th>
                                    <th>套餐外流量</th>
                                    <th>套餐外短信</th>
                                    <th>备注</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <#list pageInfo.list as item>
                                <tr>
                                    <td>${item.name!}</td>
                                    <td>${item.money!0}元/每月</td>
                                    <td>${item.minut!}分钟</td>
                                    <td>${item.traffic!}M</td>
                                    <td>${item.sms!}条</td>
                                    <td>${item.voice!}元/分钟</td>
                                    <td>${item.traffictc!}元/分钟</td>
                                    <td>${item.smstc!}元/条</td>
                                    <td>${item.remark!}</td>
                                    <td>
                                        <div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
                                            <a class="btn btn-xs btn-danger"
                                               href="javascript:if(confirm('确定要删除吗？')){location.href = '/tc/del/${item.id}'}">删除</a>
                                            <a class="btn btn-xs btn-primary" href="/tc/detail/${item.id}">详情</a>
                                        </div>
                                    </td>
                                </tr>
                                </#list>
                                </tbody>
                            </table>
                        <#include "../include/table-page.ftl"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>

<div class="modal fade" tabindex="-1" role="dialog" id="model">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">修改用户密码</h4>
            </div>
            <form action="/user/update" method="post">
                <div class="modal-body">
                    <input type="hidden" name="id" id="id">
                    <div class="form-group">
                        <input class="form-control" name="password" type="password">
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <input type="submit" class="btn btn-primary">
                </div>
            </form>
        </div>
    </div>
</div>


<div class="modal fade" tabindex="-1" role="dialog" id="modelType">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">修改用户角色</h4>
            </div>
            <form action="/user/update" method="post">
                <div class="modal-body">
                    <input type="hidden" name="id" id="idType">
                    <div class="form-group">
                        <select class="form-control" name="type">
                            <option value="admin">管理员</option>
                            <option value="doctor">医生</option>
                            <option value="user">用户</option>
                        </select>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <input type="submit" class="btn btn-primary">
                </div>
            </form>
        </div>
    </div>
</div>
<#include "../include/resource-script.ftl"/>
<script>
    function update(id) {
        $("#id").val(id);
        $("#model").modal("show");
    }

    function updateType(id) {
        $("#idType").val(id);
        $("#modelType").modal("show");
    }
</script>
</html>

